/*
Copyright 2010-2011 CumulusCloud
http://cumuluscloud.cc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package cumulusCloud.common;

import cumulusCloud.knowledge.HtmlKnow;

/**
 * This class gives some common html components to use in all the webApps to 
 * give a common look and feel accross the applications.
 * @author Simon Levesque
 *
 */
public class HtmlComponents {
	static private HtmlKnow know = HtmlKnow.getInstance();
	
	/**
	 * To display a banner with the application's name and some buttons
	 * 
	 * @param appName The text that will be shown in big
	 * @param showQuitButton Choose to have a quit button or not. Quit button goes back to the application launcher
	 * @param showLogoutButton Choose to have a logout button or not
	 * @return The html text to insert right after the <body> element
	 * @see HtmlComponents#headBannerCSS
	 */
	public static String bodyTopBanner(String appName, boolean showQuitButton, boolean showLogoutButton) {
		return know.bodyTopBanner(appName, showQuitButton, showLogoutButton);
	}
	
	/**
	 * To display the application's icon before the URL address in the browser
	 * 
	 * @param appName The name of the application (webApp folder)
	 * @param isXml Tells if it must add a inner tag closing for XHTML
	 * @return The html text to insert inside the <head> element
	 */
	public static String headApplicationIcon(String appName, boolean isXml) {
		return know.headApplicationIcon(appName, isXml);
	}
	
	/**
	 * To get the default style for the banner.
	 * If you are using the Top Banner, you need to define a style for it to display correctly.
	 * 
	 * @param isXml Tells if it must add a inner tag closing for XHTML
	 * @return The html text to insert inside the <head> element
	 * @see HtmlComponents#bodyTopBanner
	 */
	public static String headBannerCSS(boolean isXml) {
		return know.headBannerCSS(isXml);
	}
}
